package com.scau.database.controller.admin;

import com.scau.data.entity.UserDO;
import com.scau.database.service.admin.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: x1aolone
 * @Date: 2020/5/9 17:55
 */
@RestController
@RequestMapping("/api/admin")
public class UserController {

    @Autowired
    public UserService userService;

    @GetMapping("/getUser")
    public List<UserDO> getUser () {
        return userService.echo();
    }

    @PostMapping("/addUser")
    public Integer addUser (@RequestBody UserDO DO) {
        System.out.println(DO);
        return userService.addUser(DO);
    }

}
